import { get } from '../get'
import { request } from '../request'

export const getTableHead = () => {
  return get.get(`/stratum/dataBrowser/tableHead/BA_WELL`)
}

export const getTableData = (pageNum, pageSize, searchModel) => {
  return get.get(`/stratum/dataBrowser/well/${pageNum}/${pageSize}`, {
    params: searchModel
  })
}

export const downloadPDF = (fileName) => {
  return get.get(`/dataQuery/preview/${fileName}`, {
    responseType: 'arraybuffer',
    timeout: 200 * 1000,
  })
}
export const deleteFile = (data) => {
  return request.delete('/dataQuery/deleteFile', {
    data
  })
}

export const getWell = (wellName) => {
  return get.get(`/dataQuery/${wellName}`)
}
export const getNew = (fileName) => {
  return get.get(`/dataQuery/createNewFile/${fileName}`)
}
export const getTree = (wellName) => {
  return get.get(`/dataQuery/${wellName}`)
}
export const getPath = (filePath) => {
  return get.get(`/dataQuery/preview/${filePath}`)
}
export const upFile = ({fileName, wellName}) => {
  return noAuth.post('/public/login', {
    fileName,
    wellName
  })
}
